Module: client/userManagementClient
Functions
createUser
▸ createUser(data
, roleTitle
, token
): Promise
<Submission
>
Create a new user.
Parameters
Name | Type | Description |
---|---|---|
data | Object | User's login data. |
data.id | string | Id of the new user. |
data.password | string | Password of the new user. |
roleTitle | UserRoleTitle | Role to assign to the user. |
token | string | JWT token for formio. |
Returns
Promise
<Submission
>
Representing the user.
Defined in
src/web-app/src/client/userManagementClient.ts:625
deleteAssignee
▸ deleteAssignee(userSubmissionId
, token
): Promise
<void
>
Delete user with the role UserRoleTitles.ASSIGNEE from the user management system.
Parameters
Name | Type | Description |
---|---|---|
userSubmissionId | string | Id of the user submission to delete. |
token | string | JWT token for formio. |
Returns
Promise
<void
>
Throws
If the returned http status is not OK.
Throws
When a network error is encountered or CORS is misconfigured on the server-side.
Defined in
src/web-app/src/client/userManagementClient.ts:126
deleteUser
▸ deleteUser(userSubmissionId
, userRoleTitle
, token
): Promise
<void
>
Delete any user.
Parameters
Name | Type | Description |
---|---|---|
userSubmissionId | string | Id of the user submission to delete. |
userRoleTitle | UserRoleTitle | Role of the user to delete. |
token | string | JWT token for formio. |
Returns
Promise
<void
>
Defined in
src/web-app/src/client/userManagementClient.ts:345
getCurrentUser
▸ getCurrentUser(token
): Promise
<User
>
Get current user.
Parameters
Name | Type | Description |
---|---|---|
token | string | JWT token of the user. |
Returns
Promise
<User
>
Current user.
Throws
If the returned http status is not OK.
Throws
If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.
Defined in
src/web-app/src/client/userManagementClient.ts:607
loadAssignee
▸ loadAssignee(userSubmissionId
, token
): Promise
<User
| null
>
Load user with the role UserRoleTitles.ASSIGNEE based on user ID.
Parameters
Name | Type | Description |
---|---|---|
userSubmissionId | string | Id of the submission that represents the user. |
token | string | JWT token for formio. |
Returns
Promise
<User
| null
>
User or null if the user does not exist.
Throws
If the returned http status is not OK (and not 404).
Throws
If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.
Defined in
src/web-app/src/client/userManagementClient.ts:94
loadAssignees
▸ loadAssignees(root0
): Promise
<{ data
: User
[] ; totalCount
: number
}>
Load users from the user management system with the role UserRoleTitles.ASSIGNEE.
Parameters
Name | Type | Description |
---|---|---|
root0 | Object | Options. |
root0.filters? | { comparedValue : string ; fieldPath : string ; operation : "contains" }[] | Filters to apply. |
root0.pagination | Object | Pagination settings. |
root0.pagination.limit | number | - |
root0.pagination.offset | number | - |
root0.sort? | Object | Sorting configuration. |
root0.sort.field | string | - |
root0.sort.order | "asc" | "desc" | - |
root0.token | string | JWT token for formio. |
Returns
Promise
<{ data
: User
[] ; totalCount
: number
}>
List of all assignees.
Throws
If the returned http status is not OK.
Throws
If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.
Throws
If the Content-Range header is invalid or unknown.
Defined in
src/web-app/src/client/userManagementClient.ts:30
loadAssigners
▸ loadAssigners(root0
): Promise
<{ data
: User
& { mainUserRoleTitle
: UserRoleTitle
}[] ; totalCount
: number
}>
Load employees with role UserRoleTitles.ASSIGNER.
Parameters
Name | Type | Description |
---|---|---|
root0 | Object | Options. |
root0.filters? | { comparedValue : string ; fieldPath : string ; operation : "contains" }[] | Filters to apply. |
root0.pagination | Object | Pagination settings. |
root0.pagination.limit | number | - |
root0.pagination.offset | number | - |
root0.sort? | Object | Sorting configuration. |
root0.sort.field | string | - |
root0.sort.order | "asc" | "desc" | - |
root0.token | string | JWT token for formio. |
Returns
Promise
<{ data
: User
& { mainUserRoleTitle
: UserRoleTitle
}[] ; totalCount
: number
}>
Defined in
src/web-app/src/client/userManagementClient.ts:248
loadFormManager
▸ loadFormManager(root0
): Promise
<{ data
: User
& { mainUserRoleTitle
: UserRoleTitle
}[] ; totalCount
: number
}>
Load employees with role UserRoleTitles.FORM_MANAGER.
Parameters
Name | Type | Description |
---|---|---|
root0 | Object | Options. |
root0.filters? | { comparedValue : string ; fieldPath : string ; operation : "contains" }[] | Filters to apply. |
root0.pagination | Object | Pagination settings. |
root0.pagination.limit | number | - |
root0.pagination.offset | number | - |
root0.sort? | Object | Sorting configuration. |
root0.sort.field | string | - |
root0.sort.order | "asc" | "desc" | - |
root0.token | string | JWT token for formio. |
Returns
Promise
<{ data
: User
& { mainUserRoleTitle
: UserRoleTitle
}[] ; totalCount
: number
}>
Throws
If the Content-Range header is invalid or unknown.
Defined in
src/web-app/src/client/userManagementClient.ts:169
loadRoles
▸ loadRoles(token
): Promise
<Role
[]>
Load all roles from the user management system.
Parameters
Name | Type | Description |
---|---|---|
token | string | JWT token for formio. |
Returns
Promise
<Role
[]>
List of all roles.
Throws
If the returned http status is not OK.
Throws
If the response is not valid json or when a network error is encountered or CORS is misconfigured on the server-side.
Defined in
src/web-app/src/client/userManagementClient.ts:147
loginAdmin
▸ loginAdmin(email
, password
): Promise
<string
>
Logs in the admin account and returns the token.
Parameters
Name | Type | Description |
---|---|---|
email | string | Email of the admin account. |
password | string | Password of the admin account. |
Returns
Promise
<string
>
JWT token with admin privileges.
Throws
If the returned http status is not OK.
Throws
When a network error is encountered or CORS is misconfigured on the server-side.
Defined in
src/web-app/src/client/userManagementClient.ts:399
loginUser
▸ loginUser(id
, password
): Promise
<{ token
: string
; user
: User
}>
Log in as a user.
Parameters
Name | Type | Description |
---|---|---|
id | string | Id of the user. |
password | string | Password of the user. |
Returns
Promise
<{ token
: string
; user
: User
}>
User and JWT token.
Throws
If the returned http status is not OK.
Throws
When a network error is encountered or CORS is misconfigured on the server-side.